﻿<?xml version="1.0" encoding="utf-8" ?>
<Recipe Name="CreateToolOptionsPage" xmlns="http://schemas.microsoft.com/pag/gax-core"
                               xmlns:xi="http://www.w3.org/2001/XInclude" Bound="false">
  <DocumentationLinks>
    <Link Kind="Documentation" Caption="Support for Options Pages" Url="ms-help://MS.VSCC.v80/MS.VSIPCC.v80/MS.VSSDK.v80/dv_vsintegration/html/e6c0e636-5ec3-450e-b395-fc4bb9d75918.htm" />
    <Link Kind="Documentation" Caption="Walkthrough: Creating an Options Page" Url="ms-help://MS.VSCC.v80/MS.VSIPCC.v80/MS.VSSDK.v80/dv_vsintegration/html/9f4e210c-4b47-4daa-91fa-1c301c4587f9.htm" />
    <Link Kind="Documentation" Caption="Support for Settings Categories" Url="ms-help://MS.VSCC.v80/MS.VSIPCC.v80/MS.VSSDK.v80/dv_vsintegration/html/3bac375d-8bd5-41be-a8de-32eb33c5cfac.htm" />
    <Link Kind="Documentation" Caption="Walkthrough: Creating a Settings Category" Url="ms-help://MS.VSCC.v80/MS.VSIPCC.v80/MS.VSSDK.v80/dv_vsintegration/html/97c88693-05ff-499e-8c43-352ee073dcb7.htm" />
  </DocumentationLinks>
  <xi:include href="../Common/CommonTypeAliases.xml"
				xpointer="xmlns(gax=http://schemas.microsoft.com/pag/gax-core) xpointer(/gax:Types)" />
  <Caption>VS Tool Options Page</Caption>
  <Description>VS Tool Options Page</Description>
  <HostData>
    <Icon ID="3000" />
    <CommandBar Menu="VSSDKAssistProjectCreate"/>
  </HostData>
  <Arguments>
    <xi:include href="../Common/CommonArguments.xml"
					  xpointer="xmlns(gax=http://schemas.microsoft.com/pag/gax-core) xpointer(/gax:Arguments/gax:Argument)" />
    <Argument Name="VSPackageProject" Type="EnvDTE.Project, EnvDTE, Version=8.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" Required="true">
      <ValueProvider Type="VSSDKAssist.Assets.ValueProviders.VisualStudio.CurrentlySelectedProjectValueProvider, VSSDKAssist.Assets"
                     Stage="OnBeginRecipe"/>
    </Argument>
    <Argument Name="VSPackageProjectNamespace" Required="true">
      <ValueProvider Type="Evaluator"
                     Expression="$(VSPackageProject.Properties.Item('DefaultNamespace').Value.ToString())"
                     Stage="OnBeginRecipe">
      </ValueProvider>
    </Argument>
    <Argument Name="VSPackageCodeClass" Type="EnvDTE.CodeClass, EnvDTE, Version=8.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" Required="true">
      <ValueProvider Type="VSSDKAssist.Recipes.Common.ValueProviders.VSPackageCodeClassValueProvider, VSSDKAssist" 
                     Stage="OnBeginRecipe"/>
    </Argument>
    <Argument Name="DestinationFolder" Required="true">
      <ValueProvider Type="Evaluator" 
                     Expression="OptionPages" 
                     Stage="OnBeginRecipe" />
    </Argument>
    <Argument Name="ResxProjectItem" Type="EnvDTE.ProjectItem, EnvDTE, Version=8.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" Required="true">
      <ValueProvider
        Type="VSSDKAssist.Recipes.Common.ValueProviders.VSPackageResxProjectItemValueProvider, VSSDKAssist"
        VSPackageCodeClassArgument="VSPackageCodeClass" />
    </Argument>
    <Argument Name="OptionPageName" Required="true">
      <Converter Type="VSSDKAssist.Assets.Converters.CSharpIdentifierConverter, VSSDKAssist.Assets"/>
    </Argument>
    <Argument Name="OptionPageControlName" Required="false">
      <Converter Type="VSSDKAssist.Assets.Converters.CSharpIdentifierConverter, VSSDKAssist.Assets"/>
    </Argument>
    <Argument Name="OptionPageClassFileName">
      <ValueProvider Type="Evaluator"
                     Expression="$(OptionPageName).cs"
                     Stage="OnBeginRecipe">
        <MonitorArgument Name="OptionPageName"/>
      </ValueProvider>
    </Argument>
    <Argument Name="OptionPageControlClassFileName" Required="false">
      <ValueProvider Type="Evaluator"
                     Expression="$(OptionPageControlName).cs"
                     Stage="OnBeginRecipe">
        <MonitorArgument Name="OptionPageControlName"/>
      </ValueProvider>
    </Argument>
    <Argument Name="OptionPageControlDesignerClassFileName" Required="false">
      <ValueProvider Type="Evaluator"
					           Expression="$(OptionPageControlName).Designer.cs"
                     Stage="OnBeginRecipe">
        <MonitorArgument Name="OptionPageControlName"/>
      </ValueProvider>
    </Argument>
    <Argument Name="OptionPageNamespace" Required="true">
      <ValueProvider Type="Evaluator"
                     Expression="$(VSPackageProjectNamespace).$(DestinationFolder)"
                     Stage="OnBeginRecipe">
        <MonitorArgument Name="VSPackageProjectNamespace"/>
        <MonitorArgument Name="DestinationFolder"/>
      </ValueProvider>
    </Argument>
    <Argument Name="CategoryName" Required="true">
      <ValueProvider Type="Evaluator"
                     Expression="MyCategory"
                     Stage="OnBeginRecipe"/>
    </Argument>
    <Argument Name="CategoryCaption" Required="true">
      <ValueProvider Type="Evaluator"
                     Expression="My Category"
                     Stage="OnBeginRecipe"/>
    </Argument>
    <Argument Name="PageName" Required="true">
      <ValueProvider Type="Evaluator"
                     Expression="MyPage"
                     Stage="OnBeginRecipe"/>
    </Argument>
    <Argument Name="PageCaption" Required="true">
      <ValueProvider Type="Evaluator"
                     Expression="My Page"
                     Stage="OnBeginRecipe"/>
    </Argument>
    <Argument Name="IsCustomPage" Type="System.Boolean" Required="true">
      <ValueProvider Type="Evaluator" 
                     Expression="false"
                     Stage="OnBeginRecipe"/>
    </Argument>
    <Argument Name="SupportsAutomation" Type="System.Boolean" Required="true">
      <ValueProvider Type="Evaluator"
                     Expression="true"
                     Stage="OnBeginRecipe"/>
    </Argument>
    <Argument Name="SupportsExportDialog" Type="System.Boolean" Required="true">
      <ValueProvider Type="Evaluator"
                     Expression="true"
                     Stage="OnBeginRecipe"/>
    </Argument>
    <Argument Name="ExportDialogDescription" Required="false">
      <ValueProvider Type="Evaluator"
                     Expression="My description"
                     Stage="OnBeginRecipe"/>
    </Argument>
    <Argument Name="CategoryCaptionResourceId" Required="true">
      <ValueProvider Type="VSSDKAssist.Assets.ValueProviders.Framework.RandomNumberValueProvider, VSSDKAssist.Assets"
                     Stage="OnBeginRecipe"/>
    </Argument>
    <Argument Name="ExportDialogDescriptionResourceId" Required="true">
      <ValueProvider Type="VSSDKAssist.Assets.ValueProviders.Framework.RandomNumberValueProvider, VSSDKAssist.Assets"
                     Stage="OnBeginRecipe"/>
    </Argument>
    <Argument Name="PageCaptionResourceId" Required="true">
      <ValueProvider Type="VSSDKAssist.Assets.ValueProviders.Framework.RandomNumberValueProvider, VSSDKAssist.Assets"
                     Stage="OnBeginRecipe"/>
    </Argument>
    <Argument Name="OptionPageGuid" Type="System.Guid, mscorlib, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" Required="true">
      <ValueProvider Type="VSSDKAssist.Assets.ValueProviders.Framework.GuidValueProvider, VSSDKAssist.Assets"
                     Stage="OnBeginRecipe"/>
    </Argument>    
  </Arguments>
  <GatheringServiceData>
    <Wizard xmlns="http://schemas.microsoft.com/pag/gax-wizards" SchemaVersion="1.0">
      <Pages>
        <Page Type="VSSDKAssist.Recipes.CreateToolOptionsPage.CreateToolOptionsPageCP1, VSSDKAssist"
              Height="200" Width="510">
          <Title>Specify option page general properties</Title>
          <LinkTitle>Option page general properties</LinkTitle>
        </Page>
        <Page Type="VSSDKAssist.Recipes.CreateToolOptionsPage.CreateToolOptionsPageCP2, VSSDKAssist"
            Height="200" Width="510">
          <Title>Specify option page properties 1</Title>
          <LinkTitle>Option page properties 1</LinkTitle>
        </Page>
        <Page Type="VSSDKAssist.Recipes.CreateToolOptionsPage.CreateToolOptionsPageCP3, VSSDKAssist"
            Height="200" Width="510">
          <Title>Specify option page properties 2</Title>
          <LinkTitle>Option page properties 2</LinkTitle>
        </Page>        
      </Pages>
    </Wizard>
  </GatheringServiceData>
  <Actions CoordinatorServiceType="VSSDKAssist.Recipes.Common.Coordinators.ConditionalExecutionProgressCoordinator, VSSDKAssist">
    <!--Create Folder-->
    <Action Name="GenerateDestinationFolder"
          Type="VSSDKAssist.Assets.Actions.VisualStudio.AddProjectFolderAction, VSSDKAssist.Assets"
          StatusMessage="Creating destination folder"
          WriteMessageToOutputWindow="true">
      <Input Name="FolderName" RecipeArgument="DestinationFolder"/>
      <Output Name="FolderAdded" />
    </Action>
    <!-- Update Resx -->
    <Action Name="AddCategoryCaptionToResx"
            Type="VSSDKAssist.Recipes.Common.Actions.AddTextEntryToResxAction, VSSDKAssist"
            StatusMessage="Updating resource file"
            WriteMessageToOutputWindow="true">
      <Input Name="ResxProjectItem" RecipeArgument="ResxProjectItem"/>
      <Input Name="Text" RecipeArgument="CategoryCaption"/>
      <Input Name="TextResourceId" RecipeArgument="CategoryCaptionResourceId"/>
    </Action>
    <Action Name="AddPageCaptionToResx"
            Type="VSSDKAssist.Recipes.Common.Actions.AddTextEntryToResxAction, VSSDKAssist">
      <Input Name="ResxProjectItem" RecipeArgument="ResxProjectItem"/>
      <Input Name="Text" RecipeArgument="PageCaption"/>
      <Input Name="TextResourceId" RecipeArgument="PageCaptionResourceId"/>
    </Action>
    <Action Name="AddExportDialogDescriptionToResx"
            Type="VSSDKAssist.Recipes.Common.Actions.AddTextEntryToResxAction, VSSDKAssist"
            ExecuteCondition="$(SupportsExportDialog)">
      <Input Name="ResxProjectItem" RecipeArgument="ResxProjectItem"/>
      <Input Name="Text" RecipeArgument="ExportDialogDescription"/>
      <Input Name="TextResourceId" RecipeArgument="ExportDialogDescriptionResourceId"/>
    </Action>
    <Action Name="GenerateOptionPageContent"
          Type="Microsoft.Practices.RecipeFramework.VisualStudio.Library.Templates.TextTemplateAction, Microsoft.Practices.RecipeFramework.VisualStudio.Library"
          Template="TT\ToolOptionsPage\OptionPage.tt"
          StatusMessage="Creating option page class"
          WriteMessageToOutputWindow="true">
      <Input Name="IsCustomPage" RecipeArgument="IsCustomPage"/>
      <Input Name="OptionPageNamespace" RecipeArgument="OptionPageNamespace"/>
      <Input Name="SupportsAutomation" RecipeArgument="SupportsAutomation"/>
      <Input Name="OptionPageGuid" RecipeArgument="OptionPageGuid"/>
      <Input Name="OptionPageName" RecipeArgument="OptionPageName"/>
      <Input Name="OptionPageControlName" RecipeArgument="OptionPageControlName"/>
      <Input Name="CategoryName" RecipeArgument="CategoryName"/>
      <Input Name="PageName" RecipeArgument="PageName"/>
      <Output Name="Content" />
    </Action>
    <Action Name="AddOptionPageContent"
          Type="VSSDKAssist.Assets.Actions.VisualStudio.AddItemFromStringToProjectItemAction, VSSDKAssist.Assets"
          Open="true">
      <Input Name="Content" ActionOutput="GenerateOptionPageContent.Content" />
      <Input Name="TargetFileName" RecipeArgument="OptionPageClassFileName"/>
      <Input Name="InputProjectItem" ActionOutput="GenerateDestinationFolder.FolderAdded" />
    </Action>
    <!--Create OptionPageControl-->
    <Action Name="GenerateOptionPageControlContent"
          Type="Microsoft.Practices.RecipeFramework.VisualStudio.Library.Templates.TextTemplateAction, Microsoft.Practices.RecipeFramework.VisualStudio.Library"
          Template="TT\ToolOptionsPage\OptionPageControl.tt"
          StatusMessage="Creating option page control class"
          WriteMessageToOutputWindow="true"
          ExecuteCondition="$(IsCustomPage)">
      <Input Name="OptionPageNamespace" RecipeArgument="OptionPageNamespace"/>
      <Input Name="OptionPageControlName" RecipeArgument="OptionPageControlName"/>
      <Input Name="OptionPageName" RecipeArgument="OptionPageName"/>
      <Output Name="Content" />
    </Action>
    <Action Name="AddOptionPageControlContent"
          Type="VSSDKAssist.Assets.Actions.VisualStudio.AddItemFromStringToProjectItemAction, VSSDKAssist.Assets"
          Open="true"
          ExecuteCondition="$(IsCustomPage)">
      <Input Name="Content" ActionOutput="GenerateOptionPageControlContent.Content" />
      <Input Name="TargetFileName" RecipeArgument="OptionPageControlClassFileName"/>
      <Input Name="InputProjectItem" ActionOutput="GenerateDestinationFolder.FolderAdded" />
      <Output Name="ProjectItem" />
    </Action>
    <!--Create OptionPageControlDesigner-->
    <Action Name="GenerateOptionPageControlDesignerContent"
          Type="Microsoft.Practices.RecipeFramework.VisualStudio.Library.Templates.TextTemplateAction, Microsoft.Practices.RecipeFramework.VisualStudio.Library"
          Template="TT\ToolOptionsPage\OptionPageControlDesigner.tt"
          StatusMessage="Creating option page control designer class"
          WriteMessageToOutputWindow="true"
          ExecuteCondition="$(IsCustomPage)">
      <Input Name="OptionPageNamespace" RecipeArgument="OptionPageNamespace"/>
      <Input Name="OptionPageControlName" RecipeArgument="OptionPageControlName"/>
      <Output Name="Content" />
    </Action>
    <Action Name="AddOptionPageControlDesignerContent"
          Type="VSSDKAssist.Assets.Actions.VisualStudio.AddItemFromStringToProjectItemAction, VSSDKAssist.Assets"
          Open="true"
          ExecuteCondition="$(IsCustomPage)">
      <Input Name="Content" ActionOutput="GenerateOptionPageControlDesignerContent.Content" />
      <Input Name="TargetFileName" RecipeArgument="OptionPageControlDesignerClassFileName"/>
      <Input Name="InputProjectItem" ActionOutput="AddOptionPageControlContent.ProjectItem" />
    </Action>
    <!--Add ProvideOptionPage Attribute-->
    <Action Name="AddProvideOptionPageAttribute"
          Type="VSSDKAssist.Recipes.CreateToolOptionsPage.AddProvideOptionPageAttributeAction, VSSDKAssist"
          StatusMessage="Adding option page registration information"
          WriteMessageToOutputWindow="true">
      <Input Name="CodeClass" RecipeArgument="VSPackageCodeClass"/>
      <Input Name="OptionPageNamespace" RecipeArgument="OptionPageNamespace"/>
      <Input Name="OptionPageName" RecipeArgument="OptionPageName"/>
      <Input Name="CategoryName" RecipeArgument="CategoryName"/>
      <Input Name="PageName" RecipeArgument="PageName"/>
      <Input Name="CategoryCaptionResourceId" RecipeArgument="CategoryCaptionResourceId"/>
      <Input Name="PageCaptionResourceId" RecipeArgument="PageCaptionResourceId"/>
      <Input Name="SupportsAutomation" RecipeArgument="SupportsAutomation"/>
    </Action>
    <!--Add ProvideProfile Attribute-->
    <Action Name="AddProvideProfileAttribute"
          Type="VSSDKAssist.Recipes.CreateToolOptionsPage.AddProvideProfileAttributeAction, VSSDKAssist"
          ExecuteCondition="$(SupportsExportDialog)">
      <Input Name="CodeClass" RecipeArgument="VSPackageCodeClass"/>
      <Input Name="OptionPageNamespace" RecipeArgument="OptionPageNamespace"/>
      <Input Name="OptionPageName" RecipeArgument="OptionPageName"/>
      <Input Name="CategoryName" RecipeArgument="CategoryName"/>
      <Input Name="PageName" RecipeArgument="PageName"/>
      <Input Name="CategoryCaptionResourceId" RecipeArgument="CategoryCaptionResourceId"/>
      <Input Name="PageCaptionResourceId" RecipeArgument="PageCaptionResourceId"/>
      <Input Name="ExportDialogDescriptionResourceId" RecipeArgument="ExportDialogDescriptionResourceId"/>
    </Action> 
  </Actions>
</Recipe>